package ru.spb.osll.myfit.common;

public class TextParsingTools {
  
  public static final String DATA_FILE_NAME = "content.txt";
  
  public static final String PATH = "!path ";
  
  public static final String ADDRESS_BAR_SEPARATOR = "\\.";
  
  public static final String TABLE_CELL_SEPARATOR = "|";
  
  public static final String PATH_SEPARATOR = ";";
  
  public static final String CR_and_NEL = "\r\n";
  
  public static final String PAGE_PATH_ATTRIBUTE = "pagePath";
  
  public static final String URI_SEPARATOR = "/";
  
  public static final String INCLUDE = "!include ";
  
  public static final String RECURSIVE_CALL = "Recursive call of the page: ";
  
  public static final String LOADING_EXEPTION = "Error loading page: ";
  
  public static final String SETUP = "SetUp";
  
  public static final String TEARDOWN = "TearDown";
  
  /**
   * Content of header import table
   */
  public static final String IMPORT_HEADER = "Import";
  
  
  public static String getPostfix(String str, char separator) {
    int index = str.lastIndexOf(separator);
    
    return str.substring(index+1, str.length()); 
  }
  
  public static String getPrefix(String str, char separator)  {
    return str.substring(0, str.lastIndexOf(separator));
  }
}
